SELECT_COLOR = ((0, 0, 0) , (0.5, 0, 0))

class View(object):
    type = None
    _position_backup = None
    def __init__(self):
        self.selected = False
    def get_type(self):
        return self.type
    def prepare_move(self, newx, newy):
        pass
    def move(self):
        pass
    def save_current_position(self):
        pass
    def get_position_backup(self):
        return self._position_backup
    def discard_position_backup(self):
        self._position_backup = None
    def set_color(self, context):
        c1 = SELECT_COLOR[0]
        c2 = SELECT_COLOR[1]
        if self.selected:
            context.set_source_rgb(c2[0], c2[1], c2[2])
        else:
            context.set_source_rgb(c1[0], c1[1], c1[2])
    def select(self):
        self.selected = True
    def unselect(self):
        self.selected = False
    def is_selected(self):
        return self.selected
